<template>
	<view>
		<fui-card :margin="margin" color="#333" v-for="(item,index) in shopList" :key="index" :title="`录入单号：` + item.id"
			:tag="item.createTime || '暂无'">
			<view class="p-30">
				<view class="fui-card__content">
					<view class="title">商户名称</view>
					：{{item.name}}
				</view>
				<view class="fui-card__content">
					<view class="title">商户地址</view>
					：{{item.address}}
				</view>
				<view class="fui-card__content">
					<view class="title">商户电话</view>
					：{{item.phoneNumber}}
				</view>
				<view class="fui-card__content">
					<view class="title">房间数量</view>
					：{{item.hnumber}}
				</view>
				<view class="fui-card__content">
					<view class="title">推广码：</view>
					<text v-if="!item.promoterImage">暂无推广码</text>
				</view>
				<view v-if="item.promoterImage" @tap="$t.preImgIndex([item.promoterImage], 0)">
					<fui-lazyload mode="scaleToFill" marginRight="4" width="120" height="120" :src="item.promoterImage"></fui-lazyload>
				</view>
				<view class="fui-card__content">
					<view class="title">商家图片:</view>
				</view>
				<view class="flex items-center flex-wrap">
					<view v-for="(itm, key) in item.shopImage" :key="key" @tap="$t.preImgIndex(item.shopImage, key)">
						<fui-lazyload mode="scaleToFill" marginRight="4" width="120" height="120" :src="itm"></fui-lazyload>
					</view>
				</view>
			</view>
		</fui-card>
	</view>
</template>

<script>
	import Apis from '@/common/fui-apis.js'
	export default {
		data() {
			return {
				shopList: [],
				margin: ['30rpx', '32rpx', '0', '32rpx']
			}
		},
		onLoad() {
			this.getShopListData();
		},
		methods: {
			getShopListData() {
				Apis.getShop({}).then(res => {
					this.shopList = res.data;
					console.log(this.shopList)
				}).catch(err => {})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.fui-card__content {
		padding: 12rpx 0;
		display: flex;
	}

	.title {
		width: 120rpx;
		text-align: justify;
	}
</style>